package it.cums.ui;

import it.cums.ui.views.customers.CustomersView;
import it.cums.ui.views.products.ProductsView;
import it.cums.ui.views.suppliers.SuppliersView;

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

public class Perspective implements IPerspectiveFactory {

	public void createInitialLayout(IPageLayout layout) {
		String editorArea = layout.getEditorArea();
		layout.setEditorAreaVisible(true);
		
		layout.addView(CustomersView.ID, IPageLayout.LEFT, 0.25f, editorArea);
		layout.getViewLayout(CustomersView.ID).setCloseable(false);
		layout.getViewLayout(CustomersView.ID).setMoveable(false);
	    layout.addShowViewShortcut(CustomersView.ID);
		
		IFolderLayout folder = layout.createFolder("ProductsSuppliers", IPageLayout.BOTTOM, 0.50f, CustomersView.ID);
		folder.addView(ProductsView.ID);
		layout.addShowViewShortcut(ProductsView.ID);
		
		folder.addView(SuppliersView.ID);
		layout.addShowViewShortcut(SuppliersView.ID);
		
		layout.getViewLayout(ProductsView.ID).setCloseable(false);
		layout.getViewLayout(ProductsView.ID).setMoveable(false);
		
		layout.getViewLayout(SuppliersView.ID).setCloseable(false);
		layout.getViewLayout(SuppliersView.ID).setMoveable(false);
	}
}
